package org.shj.utils;

import java.io.InputStream;
import java.util.Properties;

/**
 * @author Shen Huang Jian
 * @date 2020-08-31 9:24
 */
public class PropertyUtils {

    private static Properties properties;

    static{
        properties = new Properties();
        init();
    }

    private static void init(){
        try {
            InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("config.properties");
            properties.load(is);
        }catch (Exception e){
            e.printStackTrace();
            System.exit(-1);
        }
    }

    private PropertyUtils(){}

    public static String getString(String key){
        return properties.getProperty(key);
    }
}
